
#include <QDebug>

#include "XTask.h"


XTask::XTask(const QString& left, const QString& right, QObject* parent /*= nullptr*/)
	:QObject(parent), m_left(left), m_right(right)
{

}

void XTask::fastCompareDir(const QString& left, const QString& right)
{
	QMutexLocker m(&m_mutex);
	m_param.push_front(QPair<QString, QString>(left, right));
}

void XTask::setParam(const QString& left, const QString& right)
{
	QMutexLocker m(&m_mutex);
	m_param.push_back(QPair<QString, QString>(left, right));
}


QPair<QString, QString> XTask::getParam()
{
	QMutexLocker m(&m_mutex);
	if (m_param.length() > 0)
	{
		auto p = m_param.first();
		m_param.pop_front();
		return p;
	}
	return QPair<QString, QString>();
}
